APPNAME = app
OBJECTS = cmdline.o main.o

CC = gcc

all: $(OBJECTS)
	$(CC) $(OBJECTS) -o $(APPNAME)

cmdline.o: cmdline.c
	$(CC) -c $< -o $@

main.o: main.c
	$(CC) -c $< -o $@

cmdline.c: cmdline.ggo
	gengetopt --input=cmdline.ggo --include-getopt

clean:
	rm -rf *.o $(APPNAME)
	rm -rf cmdline.c
	rm -rf cmdline.h
